package com.blb.eduadservice.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.common.entity.PromotionAd;
import com.blb.eduadservice.mapper.PromotionAdMapper;
import com.blb.eduadservice.service.IPromotionAdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 广告表 服务实现类
 * </p>
 *
 * @author xray
 * @since 2023-03-30
 */
@Service
public class PromotionAdServiceImpl extends ServiceImpl<PromotionAdMapper, PromotionAd> implements IPromotionAdService {

    @Resource
    private PromotionAdMapper promotionAdMapper;

    @Autowired
    private IPromotionAdService promotionAdService;

    /**
     * 按space_id查询轮播图
     * @param spaceId
     * @return
     */
    @Override
    public List<PromotionAd> selectBySpaceId(String spaceId) {
        List<PromotionAd> list = promotionAdService.list(new LambdaQueryWrapper<PromotionAd>()
                .eq(PromotionAd::getSpaceId, spaceId));
        return list;
    }
}
